{extend name="base" /} {block name="body"}
<div class="layui-body">
	<div class="navbar">
		<a><cite>商家联盟</cite></a>&nbsp;<span class="layui-box">&gt;</span>
		<a href="{:url('goods_type')}"><cite>自定义分类</cite></a>&nbsp;<span class="layui-box">&gt;</span>
		<a href=""><cite>添加分类</cite></a>
	</div>
	<!--tab标签-->
	<div class="layui-tab layui-tab-card margin10">
		<ul class="layui-tab-title">
			<li class="layui-this">添加分类</li>
		</ul>
		<div class="layui-tab-content">
			<form class="layui-form form-container" action="{:url('shop/add_goodstype')}" method="post">
				<div class="layui-form-item">
					<label class="layui-form-label">上级分类</label>
					<div class="layui-input-block">
						<select name="pid" class="form-control">
								<option value="0">一级分类</option>
								{foreach name="list" item="vo"}
								<option value="{$vo.id}" {if condition="$pid==$vo.id" } selected="selected" {/if}>{neq name="vo.level" value="1"}|{php}for($i=1;$i
									<$vo[ 'level'];$i++){echo ' ----';}{/php}{/neq} {$vo.name}</option>
										{/foreach}
							</select>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">分类名称</label>
					<div class="layui-input-block">
						<input type="text" name="name" value="" required lay-verify="required" placeholder="请输入分类名称" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">分类描述</label>
					<div class="layui-input-block">
						<input type="text" name="description" value="" required lay-verify="required" placeholder="请输入分类描述 " class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">状态</label>
					<div class="layui-input-block">
						<input type="radio" name="status" value="2" title="开启" checked="checked">
						<input type="radio" name="status" value="1" title="关闭">
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">排序</label>
					<div class="layui-input-block">
						<input type="text" name="sort" value="0" required lay-verify="required" class="layui-input">
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit lay-filter="*"><i class="fa fa-save"></i> 添加</button>
						<a href="{:url('goods_type')}" class="layui-btn layui-btn-primary"><i class="fa fa-arrow-left"></i> 返回</a>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<script>
	// 定义全局JS变量
	var GV = {
		current_controller: "{$controller}/goods_type"
	};
</script>
{/block}
